
<div class="base_tcdiv_mobile" style="display: none;;"></div>
<div class="chips_tanchu content" style="display: none;;">
    <div class="layout-title content">
        <div class="detail">
            <p class="m_titles">
            {if empty($workername)}
               {$theme['title']}
            {else}
                <a href="tel://{$workermobile}" style="color: #282828">客服:{$workername}/{$workermobile}</a>
            {/if}
        </p>
        </div>
        <div class="sku-layout">
            <div class="cancel-img"></div>
        </div>
    </div>
    <div class="content s_bottom">
        <ul class="content b_input">
            {if $config['shopstype'] == 0 }
                {if !empty($config['shops'])}
                <li>
                    <span class="base_ground">{$config['shops']}：</span>
                    {if !empty($config['options'])}
                    <select id="shoptitlenew" name="shoptitlenew" style="    float: left;
                        outline: none;
                        background: #ddd;
                        border: none;
                        padding: 0;
                        height: 40px;
                        line-height: 40px;
                        width: 70%;
                        text-indent: 5px;"> 
                    <option value="">请选择{$config['shops']}</option>
                    {loop $config['options'] $row}
                        <option value="{$row}" {if $row==$themyrecord['option']}selected="selected"{/if}>{$row}</option>
                    {/loop}
                    </select>
                    {/if}
                </li>
                {else}
                <input  type="hidden" name="shoptitlenew" value="默认" id="shoptitlenew">
                {/if}
            {/if}


            <li>
                <span class="base_ground">{$config['nametext']}：</span>
                <input placeholder="请输入{$config['nametext']}" type="text" name="regname_ordernew" value="{$_G['member']['username']}" id="regname_ordernew">
            </li>
            <li>
                <span class="base_ground">{$config['mobiletext']}：</span>
                <input placeholder="请输入{$config['mobiletext']}" type="tel" name="username_ordernew" value="{$_G['member']['mobile']}" id="username_ordernew">
                <input value="0" type="hidden" name="joininfoid" id="joininfoid">
            </li>

            {if $config['addresstype'] == 2 }
                {if !empty($config['address'])}
                <li>
                    <span class="base_ground">{$config['address']}：</span>
                    {if !empty($config['addressoptions'])}
                    <select id="addressnew" name="addressnew" style="    float: left;
                        outline: none;
                        background: #ddd;
                        border: none;
                        padding: 0;
                        height: 40px;
                        line-height: 40px;
                        width: 70%;
                        text-indent: 5px;"> 
                    <option value="">请选择{$config['address']}</option>
                    {loop $config['addressoptions'] $row}
                        <option value="{$row}" {if $row==$themyrecord['address']}selected="selected"{/if}>{$row}</option>
                    {/loop}
                    </select>
                    {/if}
                </li>
                {else}
                <input  type="hidden" name="addressnew" value="默认" id="addressnew">
                {/if}
            {elseif !empty($config['address']) && ($config['addresstype'] == 0 || $config['addresstype'] == 1)}
                <li {if empty($config['address'])}style="display: none;"{/if}>
                    <span class="base_ground">{$config['address']}：</span>
                    <input placeholder="{$config['address']}必填" type="{php echo $config['addresstype']==1?'tel':'text';}" name="address" value="{$member['address']}" id="address">
                </li>
            {/if}

            {if $config['shopstype'] > 0 }
                <li {if empty($config['shops'])}style="display: none;"{/if}>
                    <span class="base_ground">{$config['shops']}：</span>
                    <input placeholder="{$config['shops']}必填" type="{php echo $config['shopstype']==2?'tel':'text';}" name="shoptitle" value="{$member['option']}" id="shoptitle">
                </li>
            {/if}
            {if $config['datetimetype'] > 0 }
                <li {if empty($config['datetime'])}style="display: none;"{/if}>
                    <span class="base_ground">{$config['datetime']}：</span>
                    <input placeholder="{$config['datetime']}必填" type="{php echo $config['datetimetype']==2?'tel':'text';}" name="date_ordernew" value="{$member['datetime']}" id="date_ordernew">
                </li>
            {else}
                <li {if empty($config['datetime'])}style="display: none;"{/if}>
                    <span class="base_ground" >{$config['datetime']}：</span>
                    <input class="weui-input" placeholder="{$config['datetime']}" type="text" onfocus="(this.type='date')" value="{$member['datetime']}" name="date_ordernew" id="date_ordernew"/>
                </li>
            {/if}
            <li style=" width: 100%;float: left; height: 20px; padding-left: 0px; color: #000; {if empty($config['xieyi'])}display: none;{/if}">
                <input style="    float: left;outline: none;border: none; padding: 0;
    height: 20px;    line-height: 20px;width: 10%; text-indent: 5px;" placeholder="{$config['xieyi']}必填" type="checkbox" name="xieyinew" value="{$member['xieyi']}" id="xieyi_ordernew">
                <label>{$config['xieyi']}</label>
            </li>

        </ul>
    </div>
</div>
<div class="chips_tanchu_bottom chips_tanchu_bottom2" style="display: none;">
    <a style="width: 95%;" class="base_ground" href="javascript:;" onclick="domakeloginshare()">确认信息</a>
</div>
<input type="hidden" id="tijiao" value="0">
<input type="hidden" id="check_type" name="check_type" value="3">

<div class="chips_tanchu_bottom" style="display:none;">
    <a class="base_ground" href="javascript:;" id="topay">立即支付</a>
</div>

<script type="text/javascript">
  function domakeloginshare(){

        var status = $('#status').val();
        if(status == "0"){            
					ds.dialog({
						title : '&#25805;&#20316;&#25552;&#31034;',
						content : '&#27963;&#21160;&#23578;&#26410;&#24320;&#22987;&#21734;',
						yesText : '&#30830;&#23450;',
					    timeout :2.5,
					});
          return false;
        }
        if(status == "2"){              
					ds.dialog({
						title : '&#25805;&#20316;&#25552;&#31034;',
						content : '&#27963;&#21160;&#24050;&#32463;&#32467;&#26463;&#21862;',
						yesText : '&#30830;&#23450;',
					    timeout :2.5,
					});
          return false;
        }

        {if $isyixuan == true}             
          ds.dialog({
            title : '&#25805;&#20316;&#25552;&#31034;',
            content : '&#23458;&#25143;&#27963;&#21160;&#36827;&#34892;&#20013;&#44;&#19981;&#21487;&#27979;&#35797;',
            yesText : '&#30830;&#23450;',
              timeout :2.5,
          });
          return false;
        {/if}

        var address = $("#address_ordernew").val();
        var option = $('#shoptitlenew option:selected').val();
        var code = $('#code option:selected').val();
        var datetime = $("#date_ordernew").val();
        var xieyi = $("input[name='xieyinew']:checkbox").attr('checked');
        {if !empty($config['shops'])}
        if(option.length <=0){
          ds.dialog({
            title : '&#25805;&#20316;&#25552;&#31034;',
            content : '&#35831;&#36873;&#25321;{$config['shops']}',
            yesText : '&#30830;&#23450;',
              timeout :2.5,
          });
          return false;
        }
        {/if}
        
        var joinidv = 0;
        var username = $('#regname_ordernew').val();
        var mobile = $("#username_ordernew").val();
        if(username.length == 0){
          ds.dialog({
            title : '&#25805;&#20316;&#25552;&#31034;',
            content : '&#35831;&#36755;&#20837;{$config['nametext']}',
            yesText : '&#30830;&#23450;',
              timeout :2.5,
          });
          return false;
        }
        if(mobile.length != 11){
          ds.dialog({
            title : '&#25805;&#20316;&#25552;&#31034;',
            content : '&#35831;&#36755;&#20837;&#49;&#49;&#20301;{$config['mobiletext']}',
            yesText : '&#30830;&#23450;',
              timeout :2.5,
          });
          return false;
        }
        
        {if !empty($config['address'])}
          if(address.length <=0){
            ds.dialog({
              title : '&#25805;&#20316;&#25552;&#31034;',
              content : '&#35831;&#36755;&#20837;{$config['address']}',
              yesText : '&#30830;&#23450;',
                timeout :2.5,
            });
            return false;
          }
        {/if}
        {if !empty($config['datetime'])}
          if(datetime.length <=0){
            ds.dialog({
              title : '&#25805;&#20316;&#25552;&#31034;',
              content : '&#35831;&#36873;&#25321;{$config['datetime']}',
              yesText : '&#30830;&#23450;',
                timeout :2.5,
            });
            return false;
          }
        {/if}


        {if !empty($config['xieyi'])}
          if(xieyi != 'checked'){
            ds.dialog({
              title : '&#25805;&#20316;&#25552;&#31034;',
              content : '&#35831;{$config['xieyi']}',
              yesText : '&#30830;&#23450;',
                timeout :2.5,
            });
            return false;
          }
        {/if}

        $(".chips_tanchu_bottom").hide();
        $(".base_tcdiv_mobile").hide();//
        $(".chips_tanchu").hide();
        if(isflag){
          isflag = true;
          return false;
        }
        {php $zidiyiurl = $_G['siteroot'].createMobileUrl("saveinfo",array("op"=>"ready","themeid"=>$themeid,"recordid"=>$recordid,"workerid"=>$workerid,"fromuid"=>$fromuid,"fopenid"=>$fopenid));}
        
        $.ajax({
              type:'POST',
              dataType : "json",
              data:{joinid:joinidv,username : username,mobile:mobile,address:address,option:option,code:code,datetime:datetime},
              url:'{php echo $zidiyiurl;}',
                  success: function(data) {
                    data = data.message;
                    if(data.errcode == 110){
                      tips2('信息提交成功',window.location.href);
                      return false;
                   }else{
                     alert(data.msg);
                   }
              },
              error: function() {
                alert('错误');
              }
          });
  }

function show_group(){
    $(".base_tcdiv_mobile1").show();
    $(".my_grounp").show();
}

function close_group(){
    $(".base_tcdiv_mobile1").hide();
    $(".my_grounp").hide();
}

    var chips_tanchu = $(".chips_tanchu");

    $(".base_tcdiv_mobile,.cancel-img").click(function(){
        if (chips_tanchu.is(':hidden')) {
            $(".chips_tanchu").slideDown(500); 
            $(".chips_tanchu_bottom").show();
            $(".base_tcdiv_mobile").show();
        }
        else {
            $(".chips_tanchu").slideUp(500);
            $(".chips_tanchu_bottom").hide();
            $(".base_tcdiv_mobile").hide();
        };
    });

function showlogin(joinid){
    close_group();
    $("#joininfoid").val(joinid); 
    $(".chips_tanchu").slideDown(500); 
    $(".chips_tanchu_bottom").show();
    $(".base_tcdiv_mobile").show();
}
function showloginfree(joinid){
    close_group();
    $("#joininfoid").val(joinid); 
    $(".chips_tanchu").slideDown(500); 
    $(".chips_tanchu_bottom").hide();
    $(".chips_tanchu_bottom2").show();
    $(".base_tcdiv_mobile").show();
}

</script>